import { defHttp } from "@/utils/http";
import { baseUrlApi } from './utils'

export type DetailResult = {
  code: number;
  data: any;
  msg: string;
};

/** 编辑仓库 */
export const setWarehouseUpdate = (data?: object) => {
  return defHttp.post<DetailResult>({
    url: baseUrlApi("/warehouse/update"),
    data
  });
};

/** 仓库状态修改 */
export const setWarehouseUpdateStatus = (data?: object) => {
  return defHttp.post<DetailResult>({
    url: baseUrlApi("/warehouse/updateStatus"),
    data
  });
};

/** 仓库列表带分页 */
export const setWarehousePagelist = (data?: object) => {
  return defHttp.post<DetailResult>({
    url: baseUrlApi("/warehouse/pagelist"),
    data
  });
};

/** 仓库列表不分页 */
export const setWarehouseList = (data?: object) => {
  return defHttp.post<DetailResult>({
    url: baseUrlApi("/warehouse/list"),
    data
  });
};

/** 新增仓库 */
export const setWarehouseAdd = (data?: object) => {
  return defHttp.post<DetailResult>({
    url: baseUrlApi("/warehouse/add"),
    data
  });
};

/** 仓库级联 */
export const getWarehouseMap = (data?: object) => {
  return defHttp.post<DetailResult>({
    url: baseUrlApi("/warehouse/map"),
    data
  });
};
